<?php


namespace app\api\controller\v1;


use app\api\service\WxNotify;
use app\api\validate\IDIsInt;

class Pay extends BaseApi
{
    protected $beforeActionList = [
        'checkScope' => ['only' => 'getPreOrders']
    ];

    // 预订单
    public function getPreOrders($id='')
    {
        (new IDIsInt())->goCheck();
        $pay = new \app\api\service\Pay($id);
        return $pay->pay();
    }

    // 付款后接收微信通知
    public function receiveNotify()
    {
        $notify = new WxNotify();
        // 触发
        $notify->Handle();
    }
}